﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using AD.Web.Common;
using AD.Contract;
using AD.Contract.Models;

namespace AD.Web.Areas.BaseInfo.Controllers
{
    public class PeriodController : ADController
    {
        //
        // GET: /BaseInfo/Period/

        public ActionResult Index(CommonRequest request)
        {
            var result = this.PeriodService.GetList(request);
            return View(result);
        }
        public ActionResult Create()
        {
            var model = new Period();
           
            return View("Edit", model);
        }

        [HttpPost]
        public ActionResult Create(FormCollection collection)
        {
            
            var model = new Period();

           
            model.FlagUse = true;
            model.Comment = "";
            this.TryUpdateModel<Period>(model);

            this.PeriodService.Save(model);

            return this.RefreshParent();
        }
    }
}
